package tests;

import static org.junit.Assert.assertNotNull;

import java.sql.PreparedStatement;

import mailsystem.persistance.database.DatabaseConnection;

import org.junit.Test;


public class DataBaseConnectionTest {

	@Test
	public void TestConnection() {
		DatabaseConnection connection = new DatabaseConnection();
		
		assertNotNull(connection.getConnection());
	}
	
	@Test
	public void TestConnectionWithTestConnection() {
		
		DatabaseConnection connection = new DatabaseConnection();
		connection.changeToTestMode();
		assertNotNull(connection.getConnection());
	}
	
	@Test
	public void CreatePreparedStatement() {
		DatabaseConnection connection = new DatabaseConnection();
		PreparedStatement statement = connection.prepareStatement("SELECT * FROM Mailbox");
		
		assertNotNull(statement);
	}
}
